<?php /* Smarty version 2.6.18, created on 2016-11-30 17:09:55
         compiled from keep/m.keep.update.tpl.php */ ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="mstatic/css/bootstrap.min.css"  type="text/css" rel="stylesheet">
<link href="mstatic/css/jquery-ui.css"  type="text/css" rel="stylesheet">
<link href="mstatic/css/index.css" type="text/css" rel="stylesheet">
<title>教务处--<?php if ($this->_tpl_vars['type'] == 1): ?>继续教育<?php else: ?>其他资料<?php endif; ?>-修改</title>
</head>

<body>
<!--头部-->
<nav class="navbar navbar-default navbar-fixed-top  top" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header" style=" width:100%;"> <a class="navbar-brand" href="javascript:history.go(-1);" style=" width:100%;  padding-right:0px;"> <span class="glyphicon glyphicon-arrow-left white"></span> 
      <!--    <span class="glyphicon glyphicon-pause white" style="margin-left:2%;"></span>--> 
      <span class="white" style="margin-left:10%"><?php if ($this->_tpl_vars['type'] == 1): ?>继续教育<?php else: ?>其他资料<?php endif; ?>-修改</span> <span class="glyphicon glyphicon-user white" style="float:right"></span> </a> </div>
  </div>
  <!-- /.container-fluid --> 
</nav>
<!--头部 end--> 
<!--主体部分-->
<div class="container" style="margin-top:70px;">
  <div class="row row_margin">
    <form name="myform" action="" method="post" role="form" enctype="multipart/form-data">
    <?php if ($this->_tpl_vars['type'] == 1): ?>
     <div class="form-group">
        <label for="" class="col-sm-2  control-label">项目名称：</label>
        <div class="col-sm-10 ">
           <input type="text" name="keep_name" class="form-control" required="required" value="<?php echo $this->_tpl_vars['data']['keep_name']; ?>
">
         </div>
     </div>
     
      <div class="form-group">
        <label for="" class="col-sm-2  control-label">教师姓名：</label>
        <div class="col-sm-10 ">
          <select class="form-control" name="staff_id">
			<?php $_from = $this->_tpl_vars['teachers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			<option value="<?php echo $this->_tpl_vars['value']['staff_id']; ?>
"<?php if ($this->_tpl_vars['value']['staff_id'] == $this->_tpl_vars['data']['staff_id']): ?>selected<?php endif; ?>> <?php echo $this->_tpl_vars['value']['staff_name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?>
		  </select>
        </div>
      </div>
      
      
       <div class="form-group">
        <label for="" class="col-sm-2  control-label"><?php if ($this->_tpl_vars['type'] == 1): ?>培训日期<?php else: ?>提交日期<?php endif; ?>：</label>
        <div class="col-sm-10 ">
         <input type="text" class="form-control" name="keep_time"  id="datepicker" value="<?php echo $this->_tpl_vars['data']['keep_time']; ?>
" />
        </div>
      </div>
      <?php endif; ?>
	  <?php if ($this->_tpl_vars['type'] == 1): ?>
      
      <div class="form-group">
        <label for="" class="col-sm-2  control-label">培训机构：</label>
        <div class="col-sm-10 ">
           <input type="text" name="keep_unit" value="<?php echo $this->_tpl_vars['data']['keep_unit']; ?>
" class="form-control" required="required">
        </div>
      </div>
      
      
      <div class="form-group">
        <label for="" class="col-sm-2  control-label">学时：</label>
        <div class="col-sm-10 ">
           <input type="text" name="keep_hour"value="<?php echo $this->_tpl_vars['data']['keep_hour']; ?>
" class="form-control" required="required">
         </div>
     </div>
      
      <div class="form-group">
        <label for="" class="col-sm-2  control-label">学分：</label>
        <div class="col-sm-10 ">
          <input type="text" name="keep_min" value="<?php echo $this->_tpl_vars['data']['keep_min']; ?>
" class="form-control" required="required">
         </div>
     </div>
     <div class="form-group">
        <label for="" class="col-sm-2  control-label">实际学分：</label>
        <div class="col-sm-10 ">
           <input type="text" name="keep_score" value="<?php echo $this->_tpl_vars['data']['keep_score']; ?>
" class="form-control" required="required">
         </div>
     </div>
      <?php else: ?>
	  <div class="form-group">
        <label for="" class="col-sm-2  control-label">项目名称：</label>
        <div class="col-sm-10 ">
           <input type="text" name="keep_name" value="<?php echo $this->_tpl_vars['data']['keep_name']; ?>
" class="form-control" required="required">
         </div>
     </div>
	 <div class="form-group">
        <label for="" class="col-sm-2  control-label">文章内容：</label>
        <div class="col-sm-10 ">
           <textarea id="category_content" name="keep_content" rows="12" style="width: 100%"><?php echo $this->_tpl_vars['data']['keep_content']; ?>
</textarea>
		</div>
     </div>
	<div class="form-group">
        <label for="" class="col-sm-2  control-label">附件：</label>
        <div class="col-sm-10 ">
			<?php if ($this->_tpl_vars['keep_data']['keep_file'] != ""): ?>
			<br><input type="radio" name="keep_file_re" value="0" checked>
			<a href="upload/keep_file/<?php echo $this->_tpl_vars['keep_data']['keep_file']; ?>
" target="_blank"><?php echo $this->_tpl_vars['keep_data']['keep_file']; ?>
</a>
			<br><br><input type="radio" name="keep_file_re" value="1" > 重新上传 <input id="keep_file" name="keep_file" type="file" size="60"/>
			<?php else: ?>
			<input id="keep_file" name="keep_file" type="file" size="60"/>
			<input type="hidden" name="keep_file_re" value="1">
			<?php endif; ?>

		</div>
     </div>
	 <?php endif; ?>  
  </div>
  <!--row  end-->
  
  <div class="row row_margin" >
    <button type="submit" class="btn btn-primary btn-lg btn-block btn-primary2">确定</button>
  </div>
</div>
 </form>
<!--container  end--> 
<!--主体部分  end--> 
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "m.index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script>
  $(function() {
    $( "#datepicker" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true,
	  yearRange:"1930:2010"
    });
	$( "#datepicker1" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
	$( "#datepicker2" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
	$( "#datepicker3" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
  });
  //上传图片
  $(function(){
        var imgurl=[];
        function createfile(){
        $('#updiv').append("<input type='file'  name='photos' class='upfile'>");
        }
        function showimg(url){
            var img='<img src="'+url+'"/>';
            $('#imglist').append(img);
        }
        function addfile(){
            showimg($(this).val());
            $(this).hide();
            createfile();
            $('.upfile').bind('change',addfile);
        }
        $('.upfile').bind('change',addfile);
    })
</script>
<?php if ($this->_tpl_vars['type'] == 5): ?>
<script>
	$(function (){
		$('#keep_owner').blur(function(){
			var name = $('#keep_owner').val();
			$.post('index.php?a=keep.checks',{name:name},function ($data) {
				if($data == 0){alert('未找到相应学生');}
			});
		})
	})
</script>
<?php endif; ?>
<script type="text/javascript" src="static/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="static/xhe/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
	$('#category_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
}
function submitForm(){$('#myform').submit();}
</script>